<template>
  <section>
    <button v-on:click="greet">欢迎</button>
  </section>
</template>

<script>
export default {
  name: "Handler",
  data() {
    return {
      name: "Vue.js"
    };
  },
  methods: {
    greet(event) {
      alert(`你好：${this.name}!`);
      if (event) {
        alert(event.target.tagName);
      }
    }
  }
};
</script>